package com.rhtchr.angelbaby.domain;

import java.util.Calendar;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.apache.commons.lang.time.DateUtils;
import org.hibernate.annotations.Index;

/**
 * 注册客户信息
 * 
 * @author limingju
 * 
 */
@Entity
@Table(name = "t_customer")
public class CustomerInfo {

	public CustomerInfo() {
		super();
		java.util.Date tmp = Calendar.getInstance().getTime();
		babyBirthday = DateUtils.addMonths(tmp, 6);
		fatherBirthday = DateUtils.addYears(tmp, -30);
		motherBirthday = DateUtils.addYears(tmp, -30);

		insertTime = tmp;
		updateTime = tmp;
	}

	private Date babyBirthday;
	private int babyStatus = 2;// 默认是怀孕期间
	private int babyGender;
	private String babyName;
	private int familyIncomeLevel;
	private int fatherEducationLevel;
	private int motherEducationLevel;
	private Date motherBirthday;
	private int id;
	private String userName;
	private String password;
	private String repassWord;
	private int gender = 2; // 默认是“女”
	private Date fatherBirthday;
	private int provinceCode = 2;
	private int cityCode;
	private String mobileNumber;
	private String secondMobileNumber;
	private String email;
	private String secondEmail;
	private Date insertTime;
	private Date updateTime;

	@Column(name = "baby_birthday")
	public Date getBabyBirthday() {
		return babyBirthday;
	}

	@Column(name = "baby_gender", nullable = false)
	public int getBabyGender() {
		return babyGender;
	}

	@Column(name = "baby_status", nullable = false)
	public int getBabyStatus() {
		return babyStatus;
	}

	@Column(name = "father_birthday")
	public Date getFatherBirthday() {
		return fatherBirthday;
	}

	@Column(name = "mother_birthday")
	public Date getMotherBirthday() {
		return motherBirthday;
	}

	@Column(name = "city_code", nullable = false)
	public int getCityCode() {
		return cityCode;
	}

	@Column(name = "father_education_level", nullable = false)
	public int getFatherEducationLevel() {
		return fatherEducationLevel;
	}

	@Column(name = "mother_education_level", nullable = false)
	public int getMotherEducationLevel() {
		return motherEducationLevel;
	}

	@Column(name = "email_address", nullable = false)
	public String getEmail() {
		return email;
	}

	@Column(name = "email_address2")
	public String getSecondEmail() {
		return secondEmail;
	}

	@Column(name = "family_income")
	public int getFamilyIncomeLevel() {
		return familyIncomeLevel;
	}

	@Column(name = "gender")
	public int getGender() {
		return gender;
	}

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "id")
	public int getId() {
		return id;
	}

	@Column(name = "insert_time", nullable = false, updatable = false)
	public Date getInsertTime() {
		return insertTime;
	}

	@Column(name = "mobile_number", length = 14, nullable = false)
	@Index(name = "u_mobile_number_index", columnNames = { "mobile_number" })
	public String getMobileNumber() {
		return mobileNumber;
	}

	@Column(name = "second_mobile_number", length = 14)
	public String getSecondMobileNumber() {
		return secondMobileNumber;
	}

	@Column(name = "password", length = 32, nullable = false)
	public String getPassword() {
		return password;
	}

	@Column(name = "province_code", nullable = false)
	public int getProvinceCode() {
		return provinceCode;
	}

	@Transient
	public String getRepassWord() {
		return repassWord;
	}

	@Column(name = "update_time", nullable = false)
	public Date getUpdateTime() {
		return updateTime;
	}

	@Column(name = "user_name", length = 32, nullable = false)
	@Index(name = "u_user_name_index", columnNames = { "user_name" })
	public String getUserName() {
		return userName;
	}

	public void setBabyBirthday(Date babyExpectBirthday) {
		this.babyBirthday = babyExpectBirthday;
	}

	public void setBabyGender(int babyGender) {
		this.babyGender = babyGender;
	}

	public void setBabyStatus(int babyStatus) {
		this.babyStatus = babyStatus;
	}

	public void setFatherBirthday(Date birthday) {
		this.fatherBirthday = birthday;
	}

	public void setMotherBirthday(Date birthday2) {
		this.motherBirthday = birthday2;
	}

	public void setCityCode(int cityCode) {
		this.cityCode = cityCode;
	}

	public void setFatherEducationLevel(int fatherEducationLevel) {
		this.fatherEducationLevel = fatherEducationLevel;
	}

	public void setMotherEducationLevel(int motherEducationLevel) {
		this.motherEducationLevel = motherEducationLevel;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public void setSecondEmail(String email2) {
		this.secondEmail = email2;
	}

	public void setFamilyIncomeLevel(int familyIncomeLevel) {
		this.familyIncomeLevel = familyIncomeLevel;
	}

	public void setGender(int gender) {
		this.gender = gender;
	}

	public void setId(int id) {
		this.id = id;
	}

	public void setInsertTime(Date insertTime) {
		this.insertTime = insertTime;
	}

	public void setMobileNumber(String mobileNumber) {
		this.mobileNumber = mobileNumber;
	}

	public void setSecondMobileNumber(String mobileNumber2) {
		this.secondMobileNumber = mobileNumber2;
	}

	public void setPassword(String passWord) {
		this.password = passWord;
	}

	public void setProvinceCode(int provinceId) {
		this.provinceCode = provinceId;
	}

	public void setRepassWord(String repassWord) {
		this.repassWord = repassWord;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	@Column(name = "baby_name", length = 64)
	public String getBabyName() {
		return babyName;
	}

	public void setBabyName(String babyName) {
		this.babyName = babyName;
	}
}
